package crack.lshape;

import java.io.IOException;

import crack.AbstractLshapeConstantCrack;

import math2.MathUtilities;
import fem2.Mesh;
import fem2.MeshGenerator;
import fem2.pre_and_post.GidMeshGenerator;

/**
 * 
 * Lshape with triangle mesh by Yijian
 * 
 * @author hbui
 * 
 */
public class LshapeTriMeshYijianConstantCrack extends AbstractLshapeConstantCrack {

	public LshapeTriMeshYijianConstantCrack() {
		meshFileName = "mesh1.msh";
	}

	@Override
	public Mesh createMesh() {
		String fn = projectDir + '/' + projectName + '/' + meshFileName;
		MeshGenerator mg = new GidMeshGenerator(fn);
		Mesh mesh = mg.getMesh(2);
		return mesh;
	}

	public static void main(String[] args) throws IOException {

		AbstractLshapeConstantCrack Lshape = new LshapeTriMeshYijianConstantCrack();
		double[] lambda = MathUtilities.createLambdaArray(7.5, 0.1, 7.8);

		// double[] lambda = MyLinAlg.createLambdaArray(7.5, 0.1, 7.6, 0.05,
		// 10);

		// double[] lambda = MyLinAlg.createLambdaArray(7.5, 0.1, 7.6, 0.01,
		// 20);

		// double[] lambda = MyLinAlg.createLambdaArray(7.5, 0.1, 7.6, 0.05,
		// 40);

		// double[] lambda = MyLinAlg.createLambdaArray(7.5, 0.1, 7.6);

		Lshape.run(lambda);

	}

}
